{*
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 *}	

{$html->toolbar->title('##User Groups##')}
{$html->toolbar->custom('mass_add_group','new','','Add', true, false)}


<form name="adminForm" method="POST">
	<input type="hidden" name="checked" value="0"/>
	<input type="hidden" name="agora_task" value="usergroups"/>
	<input type="hidden" name="task" value=""/>
	<input type="hidden" name="option" value="com_agora"/>
	<input type="hidden" name="boxchecked" value="0"/>
	<table>
	<tr>
		<td align="right" valign="top" class="key ">
			<strong>##Group##</strong>
		</td>
		<td align="left">
			<select name="form[group_id]" size="8" style="width: 170px">
			{foreach from=$groups item=group}
			<option value="{$group.id}">{$html->form->treename($group,0)}</option>
			{foreachelse}
			<option disabled="disabled">##No groups left##</option>
			{/foreach}
			</select>
		</td>
	</tr>
	<tr>
		{adminform->select var='role_id' caption="Role" keys=$roles values=$roles selected=2}
	</tr>
	</table>
	
	<table class="adminlist">
		<thead>
			<th width="20">
				<input type="checkbox" name="toggle" value="" onclick="checkAll({$users|@count});" />
			</th>
			<th width="20">##Id##</th>
			<th>{$html->jhtml('grid.sort','Name','username',"$sort_dir","$sort_field",'sort')}</th>
			<th>{$html->jhtml('grid.sort','Email','email',"$sort_dir","$sort_field",'sort')}</th>
			<th>{$html->jhtml('grid.sort','Registered','registered',"$sort_dir","$sort_field",'sort')}</th>
			<th>{$html->jhtml('grid.sort','Last visit','last_visit',"$sort_dir","$sort_field",'sort')}</th>
			<th>{$html->jhtml('grid.sort','posts','num_posts',"$sort_dir","$sort_field",'sort')}</th>
			<th>##Num groups##</th>
		</thead>
		<tfoot>
			<tr><td colspan="9">{$pagination->getListFooter()}</td></tr>
		</tfoot>
		<tbody>
			{foreach from=$users item=user key=num}
			<tr>
				<td>{$html->jhtml('grid.id', $num, $user.id)}</td>
				<td>{$user.id}</td>
				<td><a href="{url task=users action=edit user_id=$user.id}">{$user.username}</a></td>
				<td>{$user.email}</td>
				<td>{$user.registered|agora_date}</td>
				<td>{$user.last_visit|agora_date}</td>
				<td>{$user.num_posts}</td>
				<td>{$user.num_groups}</td>
			</tr>
			{foreachelse}
			<tr><td colspan="9">##No users found##</td></tr>
			{/foreach}
		</tbody>
	</table>
</form>
